package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.IVoidView;

import java.util.HashMap;
import java.util.Map;

/**注册
 * Created by admin on 2018/1/8.
 */

public class RegisterPest {
    private IVoidView iVoidView;
    public RegisterPest( IVoidView iVoidView) {
        this.iVoidView = iVoidView;
    }

    public void register(String loginName,String password,String phone,String verifyCode) {
        Map<String,Object> map = new HashMap<>();
        map.put("loginName",loginName);
        map.put("password",password);
        map.put("phone",phone);
        map.put("verifyCode",verifyCode);
        new ApiManager().register(map, new BaseCallBack<ReplyUserBean.BaseResult<Void>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<Void> response) {
                iVoidView.voidView("");
            }
            @Override
            public void onFailures(String message) {
                iVoidView.showError(message);
            }
        });
    }
}
